﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Asd.Data;

namespace Asd.MP.DataAccess
{
    internal static class DIContainer
    {
        /// <summary>
        /// Default Container
        /// </summary>
        internal static readonly IUnityContainer Default;

        static DIContainer()
        {
            Default = new UnityContainer().AddNewExtension<EnterpriseLibraryCoreExtension>();
            // Default.RegisterInstance<ExceptionManager>(EnterpriseLibraryContainer.Current.GetInstance<ExceptionManager>(), new ContainerControlledLifetimeManager());
            //Default.RegisterType(typeof(IControllerBase<CustomerDataSet>), typeof(ControllerBase<CustomerDataSet>));
            //Default.RegisterType(typeof(IDataContext<CustomerDataSet>), typeof(DataContextDefault<CustomerDataSet>));
            Default.RegisterType(typeof(IDataContext<>), typeof(DataContextDefault<>));
            Default.RegisterType(typeof(IDataContext), typeof(DataContextFree));
        }
    }
}
